package com.koron.system.orgSort.controller;


import com.koron.bean.base.Response;
import com.koron.system.orgSort.bean.po.AppOrgSort;
import com.koron.system.orgSort.service.AppOrgSortService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 组织顺序表(AppOrgSort)表控制层
 *
 * @author jzp
 * @since 2022-08-25 10:37:21
 */
@Api(tags = "组织顺序表接口")
@RestController
@RequestMapping("/system/orgSort")
public class AppOrgSortController {
    /**
     * 服务对象
     */
    @Autowired
    private AppOrgSortService appOrgSortService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "根据id查询")
    @GetMapping
    public Response<AppOrgSort> selectOne(@RequestParam String id) {
        return Response.ok(appOrgSortService.getById(id));
    }

    @ApiOperation(value = "从组织表同步数据")
    @GetMapping("sync")
    public Response<String> sync() {
        appOrgSortService.sync();
        return Response.ok();
    }

}

